package com.bwie.mq;

import com.bwie.pojo.po.User;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.amqp.utils.SerializationUtils;

public class MessageConsumer2 implements MessageListener {


    @Override
    public void onMessage(Message message) {
        byte[] body = message.getBody();
        User deserialize = (User) SerializationUtils.deserialize(body);
        System.out.println("用户有: "+deserialize);
    }
}
